{

// 定义泛型，用于接收一个接口
interface Response<T> {
    status: number,
    statusText: string,
    headers: object,
    data: T
}

// 用户数据的接口
interface Users {
    id: string,
    name: string,
    age: number
}

// 数据管理的接口
interface Book {
    id: string,
    book: string,
    price: number
}

const res1: Response<Users> = {
    status: 200,
    statusText: 'OK',
    headers: { token: 'asda' },
    data: {
        id: 'asdas-asd2xce',
        name: '迪丽热巴',
        age: 18
    }
}

const res2: Response<Book> = {
    status: 304,
    statusText: 'OK',
    headers: { token: 'asdasdasd' },
    data: {
        id: 'asde3g4t75sdf22ce',
        book: '一千零一夜',
        price: 1001
    }
}

console.log(res1);
console.log(res2);


}